
/**
 * Each series gets its own axis
 *
 * @type       {boolean}
 */
var KEY_OWN_AXIS = "chart.ownaxis";
var KEY_ROLLING_WINDOW = "chart.rollingwindow";
var KEY_PERCENTILE = "chart.percentile";
var KEY_PERCENTILE_EXPANSION = "chart.percentile.expansion";
var KEY_MOUSE_INACTIVE_TIMER = "chart.inactivetimer";
var KEY_FRAME_COLOR = "chart.frame.color";


/**
 * The interval in milliseconds to automatically recalculate
 * the %tile of each Y-Axis
 *
 * @type       {integer}
 */
var KEY_PERCENTILE_INTERVAL = "percentile.recalc.interval";

/**
 * During a live window, the number of recent points to keep in a %tile 
 * calculation so that it will not obscure the most recent snapshot.
 *
 * @type       {integer}
 */
var KEY_PERCENTILE_KEEP = "liveview.include.recent.points";

/**
 * The business hours to filter data points.  Data oustide this range will be filtered.
 * example: 09:30-11:00,13:00-15:30
 *
 * @type       {string}
 */
var KEY_BUSINESS_HOURS = "business.hours";
var KEY_STATIC_START_OFFSET = "chart.xaxis.viewable.offset";

/**
 * When to enable data grouping, where approximation starts to take
 * place to improve rendering performance.
 * @deprecated unused
 *
 * @type       {integer}
 */
var KEY_APPROXIMATION_POINTS = "data.grouping.points"

/**
 * The grouping interval width, once points take more than this pixel amount, grouping will
 * be in place at that location.
 * @type {float}
 */
var KEY_DATAGROUPING_WIDTH = "data.grouping.width";

/**
 * Explicitly Disable/enable datagrouping
 * @type {string}
 */
var KEY_DATAGROUPING_ENABLED = "data.grouping.enabled";

var KEY_OHLC_START = "ohlc.start";

/**
 * ohlc/candlestick 
 */
var KEY_OHLC_CHART_TYPE = "ohlc.chartType";

/**
 * OHLC sampling period 
 */
var KEY_OHLC_PERIOD = "ohlc.period";

/**
 * Relax the datagrouping so more detail can appear when using ohlc mode
 * @type {boolean}
 */
var KEY_OHLC_DATAGROUPING_RELAXED = "ohlc.grouping.relaxed";


/**
 * own = every series gets its own axis
 * single = shared axis
 * intelligent = use percentiles to detect overlap
 * @type {string}
 */
var KEY_AXIS_TYPE = "chart.axis";

var AXIS_TYPE_INTELLIGENT = "intelligent";
var AXIS_TYPE_OWN = "own";
var AXIS_TYPE_SHARED = "shared";

/**
 * Overlap percentage to keep series on the same axis
 * 0.0 - 1.0
 * @type {string}
 */
var KEY_AXIS_OVERLAP_PCT = "chart.axis.overlap";

/**
 * The number of seconds the chart will start calculating the intelligent y axis
 * Default is two minutes
 */
var KEY_AXIS_INTELLIGENT_INTERVAL = "chart.axis.intelligent.interval";

/**
 * Threshold percentage to act,
 * KEY_AXIS_OVERLAP_PCT + KEY_AXIS_OVERLAP_THRESHOLD_PCT -> series joins the axis
 * KEY_AXIS_OVERLAP_PCT - KEY_AXIS_OVERLAP_THRESHOLD_PCT -> series splits from the axis
 * @type {string}
 */
var KEY_AXIS_OVERLAP_THRESHOLD_PCT = "chart.axis.threshold";

/**
 * Do not allow a series to move if it has moved within this many seconds
 * @type {string}
 */
var KEY_AXIS_COOLDOWN = "chart.axis.cooldown";

/**
 * Force data grouping to show these points
 * @type {string}
 */
var KEY_GROUP_SHOW_LAST_POINTS = "data.grouping.showpoints";

/**
 * Seconds where we will force the daily bloomberg view, defaults to one
 */
var KEY_BBG_DAILY_THRESHOLD = "daily.category.threshold";

var KEY_CHART_FONT_SIZE= "chart.fontsize";

var SERIES_TYPE_OHLC = "ohlc";
var SERIES_TYPE_CANDLESTICK = "candlestick";


var PARAMETERS_BASIC = [
KEY_ROLLING_WINDOW, KEY_PERCENTILE, KEY_PERCENTILE_EXPANSION, KEY_PERCENTILE_INTERVAL, KEY_PERCENTILE_KEEP, KEY_BUSINESS_HOURS, KEY_AXIS_TYPE, KEY_AXIS_OVERLAP_PCT,
KEY_GROUP_SHOW_LAST_POINTS
];

var PARAMETERS_INTELLIGENT = [
	KEY_AXIS_OVERLAP_PCT, KEY_AXIS_INTELLIGENT_INTERVAL, KEY_AXIS_OVERLAP_THRESHOLD_PCT, KEY_AXIS_COOLDOWN
];



var defaultOptions = {};
defaultOptions[ KEY_PERCENTILE ] = 1;
defaultOptions[ KEY_PERCENTILE_EXPANSION ] = .1;
defaultOptions[ KEY_PERCENTILE_INTERVAL ] = 300;
defaultOptions[ KEY_PERCENTILE_KEEP ] = 5;
defaultOptions[ KEY_APPROXIMATION_POINTS ] = 2000;
defaultOptions[ KEY_MOUSE_INACTIVE_TIMER ] = 10;
defaultOptions[ KEY_DATAGROUPING_WIDTH ] = 2;
defaultOptions[ KEY_DATAGROUPING_ENABLED ] = true;
defaultOptions[ KEY_AXIS_OVERLAP_PCT ] = 0.9;
defaultOptions[ KEY_AXIS_OVERLAP_THRESHOLD_PCT ] = .05;
defaultOptions[ KEY_AXIS_COOLDOWN ] = 60;
defaultOptions[ KEY_GROUP_SHOW_LAST_POINTS ] = 5;
defaultOptions[ KEY_FRAME_COLOR ] = "gray";
defaultOptions[ KEY_OHLC_DATAGROUPING_RELAXED ] = true;

//try to squeeze 15 (2 business weeks) days into daily
defaultOptions[ KEY_BBG_DAILY_THRESHOLD ] = 15 * 24 * 60 * 60;
defaultOptions[ KEY_AXIS_INTELLIGENT_INTERVAL ] = 120;
defaultOptions[ KEY_AXIS_TYPE ] = AXIS_TYPE_INTELLIGENT;
defaultOptions[ KEY_OHLC_CHART_TYPE ] = "OHLC";
